package com.mycjj.android.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.mycjj.android.R;
import com.mycjj.android.bean.SyceeGetRecordBaseBean.SyceeGetRecordBean.GoldRecord;

public class RecordAdapter extends TAdapter<GoldRecord>{

	private String type;
	public RecordAdapter(Context mContext,String type) {
		super(mContext);
		this.type = type;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			convertView = LayoutInflater.from(mContext).inflate(R.layout.item_gold_record_view, null);
			holder = new ViewHolder();
			holder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
			holder.tv_time = (TextView)convertView.findViewById(R.id.tv_time);
			holder.tv_status = (TextView)convertView.findViewById(R.id.tv_status);
			convertView.setTag(holder);
		}else{
			holder = (ViewHolder) convertView.getTag();
		}
		GoldRecord bean = mList.get(position);
		holder.tv_name.setText(bean.getDesc());
		holder.tv_time.setText(bean.getLogtime());
		holder.tv_status.setText(type+bean.getPoints()+"元宝");
		return convertView;
	}
	
	
	class ViewHolder{
		TextView tv_name;
		
		TextView tv_time;
		
		TextView tv_status;
	}
	
	

}
